home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 2 / LSD and 17bit Compendium Deluxe - Volume II.iso / a / prog / cprog / c_tutor.lha / C_Tutor / SIMPLEIO.C < prev    next >
Encoding:
C/C++ Source or Header  |  1986-01-28  |  362 b   |  16 lines

  1. #include "stdio.h"    /* standard header for input/output */
  2.  
  3. main()
  4. {
  5. char c;
  6.  
  7.    printf("Enter any characters, X = halt program.\n");
  8.  
  9.    do {
  10.       c = getchar();    /* get a single character from the kb */
  11.       putchar(c);       /* display the character on the monitor */
  12.    } while (c != 'X');  /* until an X is hit */
  13.  
  14.    printf("\nEnd of program.\n");
  15. }
  16.